<!DOCTYPE html>
<html lang="en" style="height:100%;width:100%;">

<head>

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link type="text/css" href="/Public/libs/bootstrap/css/bootstrap.min.css" rel="stylesheet">
        <link type="text/css" href="/Public/libs/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet">
        <link type="text/css" href="/Public/totallogin/css/reset.css" rel="stylesheet">
        <link type="text/css" href="/Public/totallogin/css/theme.css" rel="stylesheet">
        <link type="text/css" href="/Public/totallogin/images/icons/css/font-awesome.css" rel="stylesheet">
        <script src="/Public/libs/jquery-1.9.1.min.js"></script>
        <script src="/Public/libs/store.legacy.min.js"></script>
        <title>登录</title>
    </head>

    <body style="height:100%;width:100%;background-image:url('/Public/totallogin/images/bg.jpg');background-size:cover;">
        <!-- /navbar -->
        <div class="wrapper" style="position:relative;z-index:9;">
            <div class="container">
                <div class="row">
                    <div class="module module-login span4 offset4">
                        <form class="form-vertical">
                            <div class="module-head">
                                <h3>
                                    <span class="login-type-name">
                                        活动
                                    </span>
                                    登录</h3>
                            </div>
                            <div class="module-body">
                                <div class="control-group">
                                    <div class="controls row-fluid">
                                        <input class="span12 uname-input" type="text" name="username" id="inputEmail" placeholder="用户名" required>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <div class="controls row-fluid">
                                        <input class="span12 upassword-input" type="password" name="password" id="inputPassword" placeholder="密码" required>
                                    </div>
                                </div>
                            </div>
                            <div class="module-foot">
                                <div class="control-group">
                                    <div class="controls clearfix">
                                        <button type="button" class="btn btn-primary pull-right submit-btn">登录</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>

        <div class="footer" style="position:absolute;bottom:0px;width:100%;">
            <div class="container" style="text-align:center;width:100%;">
                <b class="copyright">&copy; 2016 Admin - EGrappler </b>All rights reserved. More Templates
                <a href="" title="初阳科技" style="color:#fff;">后台管理</a> - Collect from
                <a href="" title="初阳科技" style="color:#fff;">初阳科技</a>
            </div>
        </div>
    </body>
    <script>
        $(function () {
            $('.submit-btn').on('click', function () {
                var uname = $('.uname-input').val();
                var upassword = $('.upassword-input').val();
                if (uname && upassword) {
                    $.ajax({
                        type: 'POST',
                        url: '/admin.php/Login/login',
                        data: {
                            'uname': uname,
                            'upassword': upassword
                        },
                        success: function (data) {
                            if (data['return_code'] == 1) {
                                window.location.replace('/admin.php/Index/index');
                            } else {
                                alert(data['return_msg']);
                            }
                        },
                        error: function (err) {

                        }
                    })

                } else {
                    alert('格式错误');
                }

            })
        });
    </script>

</html>